'use strict';

const Controller = require('egg').Controller;

class CountryController extends Controller {
    // resources  index / create / destroy / update
    // 查询
    async index() {
        let countryList = await this.ctx.service.country.index();
        this.ctx.body = countryList;
    }
    // 添加
    async create() {
        let countryList = await this.ctx.service.country.create();
        this.ctx.body = countryList;
    }
    // 删除
    async destroy() {
        let countryList = await this.ctx.service.country.destroy();
        this.ctx.body = countryList;
    }
    // 修改
    async update() {
        let countryList = await this.ctx.service.country.update();
        this.ctx.body = countryList;
    }
}

module.exports = CountryController;
